0 DIMC1,CC,P,K:GOTO5
1 C1=1:CC=32
2 IFMID$(M$,CC,1)<>""ANDMID$(M$,CC,1)<>" "THENCC=CC-1:GOTO2
3 PRINTMID$(M$,C1,CC-C1):C1=CC+1:CC=C1+31:IFC1<LEN(M$)THEN2
4 RETURN
5 CLS:PRINT"DOMINOES":PRINT"VERSION  2.1":PRINT"BY PETER KIRSCH":PRINT"JULY 1980":PRINT"MC-10 VERSION":PRINT"BY JIM GERRIE"
10 CLEAR1000:K=RND(-(PEEK(9)*256+PEEK(10))):GT=100:G=140:P=16384:DIMA$(28),D(20),P$(20),T$(20),P1$(20)
15 G$(1)="BLOCK GAME":G$(2)="DRAW GAME":G$(3)="BERGEN":CH=-1:PB=7:TB=7:BN=14:DB=1
20 C=1:FORA=0TO6:FORB=0+ATO6:A$(C)=STR$(A)+STR$(B):C=C+1:NEXT:NEXT
22 IFGM=1THEN190
23 GM=1
25 FORA=1TO16:D(A)=448+((A-1)*2):NEXT:FORA=1TO4:D(16+A)=A*64+94:NEXT:FORZZ=1TO2500:NEXT
30 CLS
40 PRINT@0,"DOMINOES";:L=RND(6):GOSUB1000:L=RND(6):GOSUB1040
50 PRINT@32,"CHOOSE GAME";:FORA=1TO3:PRINT@32*A+16,STR$(A)". "G$(A);:NEXT
60 A$=INKEY$:FORB=1TO125:NEXT:POKEP+32+12,63:FORA=1TO125:NEXT:POKEP+32+12,32:IFA$=""THEN60
65 D=VAL(A$):IFD<1ORD>3THEN60
66 POKEP+32+12,96:IFD=3THENGT=15
67 IFD=1THENGT=50
68 IFD=2THENGS=1
70 PRINT@480,"DO YOU WANT RULES? (Y/N)";
71 A$=INKEY$:IFA$=""THEN71
72 IFA$="N"THENCLS:GOTO100
73 IFA$="Y"THEN75
74 GOTO71
75 CLS:M$="DOMINOES ARE PLAYED WITH A DOUBLE-SIX PACK OF 28 TILES (CALLED BONES) WITH PIPS (OR SPOTS) RANGING FROM 0/0 TO 6/6. 
76 GOSUB1:M$="PLAYERS ARE DEALT 6 OR 7 BONES (DEPENDING ON GAME). THE REST OF THE PACK IS CALLED THE BONEYARD (OR JUST YARD) "
77 GOSUB1:M$="AND IS SET ASIDE FOR LATER. THE PRIMARY OBJECT OF DOMINOES IS TO BE THE FIRST TO PLAY ALL YOUR TILES AND GO "
78 M$=M$+"OUT, OR HAVE THE LOWEST PIP COUNT LEFT IN HAND WHEN PLAY ENDS.":GOSUB1:GOSUB5000:CLS
79 M$="PLAYERS, IN TURN, LAY TILES IN A LONG CHAIN, MATCHING ADJACENT ENDS. THE LARGE DOMINO IN THE DISPLAY SHOWS BOTH ENDS OF 
80 M$=M$+"THE CHAIN. YOU NEED MERELY TO KEY IN THE NUMBERS OF THE TILE YOU WISH TO PLAY AND IT WILL BE PLACED FOR YOU. "
81 GOSUB1:M$="YOU NEED NOT PRESS ENTER. YOUR DOMINOES WILL BE DISPLAYED ALONG THE BOTTOM OF THE SCREEN.":GOSUB1:PRINT
82 M$="STARTING (SETTING) AND SCORING DIFFERS WITH GAME PLAYED.":GOSUB1:GOSUB5000:GOSUB986:ONDGOTO90,93
83 M$="PLAYERS ARE DEALT 6 BONES INSTEAD OF 7. GAME IS PLAYED TO 15 POINTS. THE LOWEST DOUBLE MUST BE SET AND THE HOLDER "
84 M$=M$+"SCORES 2 POINTS. THE OBJECT OF THE GAME IS TO MATCH BOTH ENDS OF THE CHAIN, MAKING BOTH ENDS ALIKE.":GOSUB1
85 M$="YOU SCORE 2 POINTS FOR A DOUBLE-HEADER.  IF ONE END OF THE CHAIN HAS A DOUBLE OR IF THE "
86 M$=M$+"PLAYER PLAYS A DOUBLE, HE SCORES 3 POINTS FOR A TRIPLE-HEADER.":GOSUB1:GOSUB5000:M$="A 'D' NEXT TO THE DOMINO "
87 M$=M$+"INDICATES A DOUBLE ON THAT END OF THE CHAIN. IF A PLAYER GOES OUT, HE GETS 1 ADDITIONAL POINT.":GOSUB1
88 M$="ALL BONES IN THE YARD ARE PLAYED. IF YOU CANNOT PLAY YOU MUST DRAW ONE BONE AND ONLY ONE. IF YOU STILL CANNOT "
89 M$=M$+"PLAY, YOU MUST PASS. IF THE YARD IS USED UP, 2 CONSECUTIVE PASSES ENDS PLAY.":GOSUB1:GOSUB5000:GOTO100
90 M$="PLAYER HAVING THE HIGHEST DOUBLE MUST START AND SET IT. THERE IS NO DRAW FROM THE YARD.":GOSUB1
91 M$="PLAYERS PLAY ONLY WITH TILES DEALT. WHEN YOU CAN'T PLAY, YOU MUST PASS. TWO CONSECUTIVE PASSES "
92 M$=M$+"ENDS PLAY. GAME IS PLAYED TO 50 POINTS.":GOSUB1:GOSUB98:GOTO100
93 M$="PLAYERS DRAW BONES TO SEE WHO SETS FIRST, HIGHEST TILE (TOTAL PIPS) STARTING AND PLACING ANY HE OWNS.":GOSUB1
94 M$="IF A PLAYER CANNOT PLAY A TILE, HE MUST DRAW ONE OR MORE FROM THE YARD UNTIL HE CAN PLAY AND PLAY IT.":GOSUB1
95 M$="THE LAST 2 BONES IN THE YARD ARE FROZEN AND MAY NOT BE PICKED. A PLAYER MAY NOT PASS UNTIL THEN. "
96 M$=M$+"TWO CONSECUTIVE PASSES ENDS PLAY. GAME IS PLAYED TO 100 POINTS.":GOSUB1:GOSUB5000:CLS
97 M$="SCORING: IF ONE PLAYER GOES OUT, HE SCORES THE SUM OF THE PIPS ON HIS OPPONENT'S UNPLAYED TILES.":GOSUB1
98 M$="IF NO ONE GOES OUT, THE PLAYER WITH THE FEWEST REMAINING PIPS WINS AND SCORES THE DIFFERENCE BETWEEN HIS AND HIS "
99 M$=M$+"OPPONENT'S.":GOSUB1:GOSUB5000:ON1-(D=1)GOTO100:RETURN
100 GOSUB2000:IFD<>2THEN190
101 PRINT@10*32,"WE'LL DRAW TO SEE WHO STARTS":GOSUB550:CH=0
110 A=RND(28):B=RND(28):IFA=BTHEN110
111 A1=VAL(MID$(A$(A),2,1))+VAL(RIGHT$(A$(A),1)):B1=VAL(MID$(A$(B),2,1))+VAL(RIGHT$(A$(B),1))
112 PRINT@11*32,"I DREW A"A$(A)", YOU DREW A"A$(B);
120 IFA1=B1THENPRINT@12*32,"WE BOTH HAVE"A1"PIPS":PRINT@13*32,"WE'LL REDRAW":GOSUB550:GOSUB150:FORA=1TO999:NEXT:GOTO110
130 IFA1>B1THENPRINT@12*32,"I HAVE"A1"AND YOU HAVE"B1"PIPS":PRINT@13*32,"I START":GOSUB550:GOSUB150:Z2=2:PL=1:GOTO190
140 IFB1>A1THENPRINT@12*32,"YOU HAVE"B1"AND I HAVE"A1"PIPS":PRINT@13*32,"YOU START":GOSUB550:Z2=1:PL=2:GOSUB150:GOTO190
150 FORZZ=10TO13:PRINT@ZZ*32,"":NEXT:RETURN
190 IFD=3THENTB=6:PB=6:BN=16
200 FORA=1TOPB
210 C=RND(28):IFA$(C)=""THEN210
211 P$(A)=A$(C):A$(C)="":NEXT:FORA=1TOTB
220 C=RND(28):IFA$(C)=""THEN220
221 T$(A)=A$(C):A$(C)="":GOSUB3000:NEXT:GOSUB986:PRINT@1*32,"SCORE  MC-10:";:PRINT@1*32+20,"YOU:";
222 PRINT@2*32,"TILES       :";:PRINT@2*32+20,"   :";:IFD>1THENPRINT@4*32+10,"YARD:";
223 PRINT@3*32,"LAST        :";:PRINT@3*32+20,"   :";:PRINT@4*32,"CHAIN:";:PRINT@4*32+20,"PTS:"GT;
226 GOSUB1100:FORA=1TOPB:PRINT@D(A),MID$(P$(A),2,1);:PRINT@D(A)+32,RIGHT$(P$(A),1);:NEXT
228 ON D GOTO235,231,260
231 IFZ2=1THENPRINT@416,"YOUR TURN TO SET    ";:FORA=1TO1500:NEXT:PL=2:GOTO300
232 IFZ2=2THENPRINT@416,"MY TURN TO SET     ";:FORA=1TO1500:NEXT:PL=1:GOTO300
235 A3=7:PRINT@416,"HIGHEST DOUBLE STARTS";:GOTO270
260 A3=1:PRINT@416,"LOWEST DOUBLE STARTS";
270 HM=0:TR=0:H=0:T=0
280 A3=A3-1:FORA=1TOPB:A2$=STR$(ABS(A3)):A2$=MID$(A2$,2,1)
281 IFMID$(P$(A),2,1)=A2$ANDRIGHT$(P$(A),1)=A2$THENH=ABS(A3):HM=1:TM=A:A=PB:NEXTA:A=TM:GOTO288
285 IF((A3=0)*(D=1))+((A3=-6)*(D=3))THENTM=A:A=PB:NEXTA:A=TM:GOTO288
286 NEXTA:GOTO280
288 IFD=1THENA3=7
289 IFD=3THENA3=1
290 A3=A3-1:FORW=1TOTB:A2$=STR$(ABS(A3)):A2$=MID$(A2$,2,1)
291 IFMID$(T$(W),2,1)=A2$ANDRIGHT$(T$(W),1)=A2$THENT=ABS(A3):TR=1:TM=W:W=TB:NEXTW:W=TM:GOTO295
292 IF((A3=0)*(D=1))+((A3=-6)*(D=3))THENTM=W:W=TB:NEXTW:W=TM:GOTO9000
293 NEXTW:GOTO290
295 GOSUB9090:PRINT@416,"";:IFD=1THEN9060
296 IFD=3THEN9080
299 REM PRINT@10*32,"";:FORJ=1TOTB:PRINTT$(J)" ";:NEXT:INPUTA$
300 Q1=0:DB=0:GOSUB1100:GOSUB1300:IF((TB=0)+(PB=0))+((Q6=1)*(Q7=1))THEN1200
301 IFPL=1THENPRINT@39,"MC-10";:FORZZ=P+39TOP+43:POKEZZ,PEEK(ZZ)-64:NEXT:PRINT@52,"YOU";:GOTO500
302 PRINT@39,"MC-10";:PRINT@52,"you";:PRINT@6*32,"OPTIONS:";
303 PRINT@7*32,"PLAY (##)";:PRINT@8*32,"PASS (P)";:IF(D>1)*((BN>2)+(D=3))*(BE=0)THENPRINT@9*32,"DRAW (D)";
305 Q6=0:PRINT@10*32,"PLAYED:    ":PRINT@11*32,"? / ?"
310 POKE11*32+P,63:FORZZ=1TO125:NEXT:POKE11*32+P,32:FORZZ=1TO125:NEXT:A$=INKEY$:IFA$=""THEN310
311 IFA$="P"THEN560
312 IFA$="D"THENIF(BN=0)+(BE=1)THENPRINT@416,"SORRY, YOU CAN'T":GOTO310
315 IFA$="D"THEN580
320 IFASC(A$)<48ORASC(A$)>54THEN310
322 PRINT@11*32,A$;
325 POKE11*32+P+4,63:FORZZ=1TO125:NEXT:POKE11*32+P+4,32:FORZZ=1TO125:NEXT:B$=INKEY$:IFB$=""THEN325
326 IFASC(B$)<48ORASC(B$)>54THEN325
330 C$=A$+B$:D$=RIGHT$(C$,1)+LEFT$(C$,1):FORA=1TOPB:Y$=MID$(P$(A),2,1):F$=RIGHT$(P$(A),1):E$=Y$+F$
331 IF(E$=C$)+(E$=D$)THENTM=A:A=PB:NEXTA:A=TM:GOTO335
332 NEXTA:PRINT@416,"YOU DON'T HAVE THAT ONE":GOTO305
335 PRINT@3*32+25,A$"/"B$" ":PRINT@11*32+4,B$;:IF(RT=LT)+(GS=1)THEN337
336 IF((VAL(A$)=LT)*(VAL(B$)=RT))+((VAL(A$)=RT)*(VAL(B$)=LT))THEN480
337 PRINT@11*32+4,B$;:IFD=2THENIFPL=2THENIFZ2=1THENIFGS=1THENGS=0:L=VAL(A$):CH=-1:HA=1:Z2=2:GOTO900
340 IFVAL(A$)=LT THENL=VAL(B$):GOTO900
341 IFVAL(A$)=RT THENL=VAL(B$):GOTO950
350 IFVAL(B$)=LT THENL=VAL(A$):GOTO900
351 IFVAL(B$)=RT THENL=VAL(A$):GOTO950
360 PRINT@416,"YOU CAN'T MATCH IT":GOTO305
380 Q6=1:PRINT@3*32+25,"PASS";:PL=1:BE=0:IFD=3THENIFBN>0THENQ6=0
385 GOTO300
390 BN=BN-1:PB=PB+1:PRINT@3*32+25,"DRAW";:IFD=3THENBE=1
392 C=RND(28):IFA$(C)=""THEN392
393 P$(PB)=A$(C):A$(C)="":A=PB:PRINT@D(A),MID$(P$(A),2,1);:PRINT@D(A)+32,RIGHT$(P$(A),1);:GOTO300
400 IFGS=1THENIFZ2=2THENZ2=1:GS=0:HA=1:W=RND(6)+1:L=VAL(MID$(T$(W),2,1)):S1=VAL(RIGHT$(T$(W),1)):PL=1:GOSUB980:GOTO900
401 GOTO501
410 IFC(S)>1THENTM=W:W=TB:NEXTW:W=TM:L=S:S1=LT:GOSUB980:GOTO900
411 L=S:Q1=1:S1=LT:W1=W:GOTO504
420 IFC(S)>1THENTM=W:W=TB:NEXTW:W=TM:L=S:S1=RT:GOSUB980:GOTO950
421 L=S:Q1=2:S1=RT:W1=W:GOTO508
430 IFC(S)>1THENTM=W:W=TB:NEXTW:W=TM:L=S:S1=LT:GOSUB980:GOTO900
431 L=S:Q1=1:S1=LT:W1=W:GOTO512
440 IFC(S)>1THENTM=W:W=TB:NEXTW:W=TM:L=S:S1=RT:GOSUB980:GOTO950
441 L=S:Q1=2:S1=RT:W1=W:GOTO516
450 IFQ1=1THEN900
451 GOTO950
470 FORA=1TOPB:IFP$(A)=""THENNEXTA:PB=PB-1:PL=1:GOTO300
471 A3=A3+1:P1$(A3)=P$(A):NEXTA:P$(PB)="":GOTO965
480 PRINT@416,"WHICH END, L OR R?"
481 Z$=INKEY$:IFZ$=""THEN481
482 IFZ$="L"THENL=RT:GOTO900
483 IFZ$="R"THENL=LT:GOTO950
484 GOTO481
500 Q7=0:FORZZ=10TO12:PRINT@32*ZZ,"":NEXT:IFD=2THEN400
501 IF(D=3)*(DB=0)THEN600
502 FORW=1TOTB:S=VAL(RIGHT$(T$(W),1))
503 IFVAL(MID$(T$(W),2,1))=LT THEN 410
504 NEXTW
505 FORW=1TOTB
506 S=VAL(RIGHT$(T$(W),1))
507 IFVAL(MID$(T$(W),2,1))=RT THEN 420
508 NEXTW
509 FORW=1TOTB
510 S=VAL(MID$(T$(W),2,1))
511 IFVAL(RIGHT$(T$(W),1))=LT THEN 430
512 NEXTW
513 FORW=1TOTB
514 S=VAL(MID$(T$(W),2,1))
515 IFVAL(RIGHT$(T$(W),1))=RT THEN 440
516 NEXTW
517 IFQ1<>0THENW=W1:GOSUB980:GOTO 450
518 IF((BN<3)*(D<>3))+(D=1)+(BE=1)+(BN=0)THEN530
519 PRINT@3*32+14,"DRAW";:PRINT@416,"I'LL DRAW FROM THE YARD":SOUND100,2:BN=BN-1:TB=TB+1:IFD=3THENBE=1
524 C=RND(28):IFA$(C)=""THEN524
525 FORA=1TOTB:IFT$(A)=""THENT$(A)=A$(C):TM=A:A=TB:NEXTA:A=TM:GOTO529
526 NEXTA:T$(TB)=A$(C):A=TB
529 A$(C)="":GOSUB3000:FORA=1TO2000:NEXT:GOTO299
530 Q7=1:PRINT@3*32+14,"PASS";:PRINT@416,"I'LL HAVE TO PASS":SOUND50,2:BE=0:PL=2:FORA=1TO2000:NEXT:IFD=3THENIFBN>0THENQ7=0
540 GOTO300
550 FORA=1TO4000:NEXT:RETURN
560 IFD>1ANDBN>2ANDBE=0THENPRINT@416,"YOU MUST DRAW":GOTO310
570 GOTO380
580 IFD=1THENPRINT@416,"NOT IN THIS GAME":GOTO310
581 IF(D=2)*(BN<3)THENPRINT@416,"* YARD IS FROZEN *":GOTO310
582 GOTO390
600 DM$=STR$(LT)+STR$(RT):MD$=STR$(RT)+STR$(LT):FORW=1TOTB:IFT$(W)=DM$THENTM=W:W=TB:NEXTW:W=TM:GOTO610
601 NEXTW
605 FORW=1TOTB:IFT$(W)=MD$THENTM=W:W=TB:NEXTW:W=TM:GOTO620
606 NEXTW:GOTO502
610 L=VAL(RIGHT$(DM$,1)):S1=LT:GOSUB980:GOTO900
620 L=VAL(MID$(MD$,2,1)):S1=LT:GOSUB980:GOTO900
900 BE=0:PRINT@256+11," ";:CH=CH+1:LT=L:GOSUB1000
902 GOSUB1510:LD=0
903 IFHA=1THENHA=0:L=VAL(B$):S1=L:GOTO950
905 IFDB=1THENIFPL=1THENGOSUB981
910 IFDB=1THEN950
911 GOTO960
950 BE=0:PRINT@256+25," ";:CH=CH+1:RT=L:GOSUB1040
955 GOSUB1510:RD=0
960 GOSUB1500:A4=A:IFPL=1THENPL=2:FORA1=1TO2000:NEXT:TB=TB-1:GOTO299
961 IFNOT(PL=2)THEN964
962 FORA2=1TO7:FORA1=1TO125:NEXT:PRINT@D(A4),MID$(P$(A4),2,1);:PRINT@D(A4)+32,RIGHT$(P$(A4),1);
963 FORA1=1TO125:NEXT:PRINT@D(A4)," ";:PRINT@D(A4)+32," ";:NEXT:P$(A4)=""
964 A3=0:GOTO470
965 FORA=1TOPB:P$(A)=P1$(A):NEXT:FORA=1TOPB:PRINT@D(A),MID$(P$(A),2,1);
966 PRINT@D(A)+32,RIGHT$(P$(A),1);:NEXT:PRINT@D(A-1)," ";:PRINT@D(A-1)+32," ";:PL=1:PB=PB-1:GOTO300
980 A$=MID$(T$(W),2,1):B$=RIGHT$(T$(W),1):PRINT@416,"I'LL PLAY THE "A$"/"B$:SOUND150,2:PRINT@3*32+14,A$"/"B$" ";
981 T$(W)="":FORA=1 TO TB:IFT$(A)=""THENFORA3=A TO TB:T$(A3)=T$(A3+1):NEXTA3:T$(A3+1)=""
982 NEXTA:IFNOT(DB=0)THEN985
983 IFA$=B$THENC(L)=C(L)-2:GOTO985
984 C(L)=C(L)-1:C(S1)=C(S1)-1
985 RETURN
986 PRINT@((32-LEN(G$(D)))/2),G$(D):RETURN
999 REM DRAW LEFT
1000 ONL+1GOSUB 9600,9610,9620,9630,9640,9650,9660
1010 FORK=0TO3:PRINT@32*(6+K)+12,DD$(K);:NEXT:GOSUB9510:RETURN
1039 REM DRAW RIGHT
1040 ONL+1GOSUB 9600,9610,9620,9630,9640,9650,9660
1050 FORK=0TO3:PRINT@32*(6+K)+19,DD$(K);:NEXT:RETURN
1100 PRINT@45,TT;:PRINT@56,TP;:PRINT@77,TB;:PRINT@88,PB;:PRINT@134,CH;
1102 IFD>1THENPRINT@143,BN;
1103 IFD=2THENIFBN<3THENPRINT@143,"*";:PRINT@145,"*";
1105 IF(DB=1)+(GS=1)THENPRINT@134," 0 ";
1106 IFPB<12THENPRINT@505,CHR$(95)"BONES";
1107 IFPB=12THENPRINT@505,"      ";
1110 RETURN
1200 ST=0:SP=0
1201 FORA=0TOTB:ST=ST+VAL(MID$(T$(A),2,1))+VAL(RIGHT$(T$(A),1)):NEXT
1202 FORA=1TOPB:SP=SP+VAL(MID$(P$(A),2,1))+VAL(RIGHT$(P$(A),1)):NEXT
1205 PRINT@39,"MC-10";:PRINT@52,"YOU";:GOSUB150:PRINT@416,"** HANDPLAY OVER **":FORA=1TO2500:NEXT
1207 IFNOT(D=3)THEN1210
1208 IFTB=0THENPRINT@416,"I GET 1 POINT FOR GOING OUT":TT=TT+1:GOTO1210
1209 IFPB=0THENPRINT@416,"YOU GET 1 POINT FOR GOING OUT":TP=TP+1
1210 IFD=3THEN1280
1211 IFTB=0THENTT=TT+SP:GO=1:GOTO1220
1212 IFPB=0THENTP=TP+ST:GO=2:GOTO1220
1213 IFST>SPTHENTP=TP+(ST-SP):GO=3:GOTO1220
1214 IFSP>STTHENTT=TT+(SP-ST):GO=4:GOTO1220
1215 PRINT@11*32,"DRAWN HAND--"SP"PIPS EACH":GOTO1280
1220 GOSUB1100:PRINT@11*32,"";:ON GO GOTO1230,1240,1250,1260
1230 PRINT"I WIN THE HAND--HA HA":GOTO1280
1240 PRINT"I GUESS YOU WIN THE HAND":PRINT@12*32,"I HAVE"ST"PIPS":GOTO1280
1250 PRINT"YOU HAVE"SP"PIPS AND I HAVE"ST:PRINT@12*32,"YOUR COUNT IS LOWER THAN MINE":PRINT@416,"YOU WIN THE HAND"
1251 GOTO1280
1260 PRINT"I HAVE"ST"PIPS AND YOU HAVE"SP:PRINT@384,"MY COUNT IS LOWER THAN YOURS":PRINT@416,"I WIN THE HAND"
1280 GOSUB1100:FORA=1TO2500:NEXT:GOSUB1300:PRINT@6*32,"TO DEAL    ";:PRINT@7*32,"PRESS      ";:PRINT@8*32,"enter      ";
1290 PRINT@9*32,"           ";:IFD=2THENGS=1
1291 FORZZ=0TO4:POKE8*32+P+ZZ,32:NEXT:FORZZ=1TO125:NEXT:PRINT@8*32,"enter      ";:FORZZ=1TO125:NEXT
1292 A$=INKEY$:IFA$=""THEN1291
1293 IFASC(A$)<>13THEN1291
1294 ST=0:GOSUB2000:FORA=6TO9:PRINT@A*32,"":NEXT:SP=0:Q7=0:Q6=0
1295 PRINT@416,"* SHUFFLING *":FORA=1TO20:P$(A)="":T$(A)="":NEXT:FORA=0TO6:C(A)=0:NEXT:GOTO15
1300 IFTT>=GTTHENH$="I":GOTO1350
1301 IFTP>=GTTHENH$="YOU":SOUND89,1:SOUND108,1:SOUND125,1:SOUND133,1:SOUND147,1:SOUND159,1:SOUND170,1:SOUND176,1:GOTO1350
1310 RETURN
1350 FORA=1TO7:FORB=1TO300:NEXT:PRINT@416,""
1351 FORB=1TO300:NEXT:PRINT@384,H$" WIN THE MATCH":NEXT:PRINT@416,"TO PLAY AGAIN PRESS ENTER";:INPUTA$:RUN
1400 FORZZ=1TO2500:NEXT:PRINT@416,"2 POINT STARTER":FORZZ=1TO2500:NEXT:RETURN
1500 IFD<>3THENRETURN
1501 IFNOT(A$=B$)THEN1505
1502 IFLT=VAL(A$)THENLD=1:PRINT@256+11,"D";:GOTO1505
1504 IFRT=VAL(B$)THENRD=1:PRINT@256+25,"D";
1505 RETURN
1510 IFD<>3ORDB=1THEN1515
1511 IFRT=LTTHEN1520
1515 RETURN
1516 IFLD=1OR RD=1ORA$=B$THENTT=TT+3:H$="TRIPLE":GOTO1550
1517 TT=TT+2:H$="DOUBLE":GOTO1550
1520 IFPL=1THEN1516
1530 IFNOT(PL=2)THEN1540
1531 IFLD=1OR RD=1ORA$=B$THENTP=TP+3:H$="TRIPLE":GOTO1550
1532 TP=TP+2:H$="DOUBLE":GOTO1550
1540 STOP
1550 PRINT@416,"":FORA5=1TO5:FORA6=1TO300:NEXT:PRINT@416,H$" HEADER":FORA6=1TO500:NEXT:PRINT@416,"":NEXT:RETURN
2000 FORZZ=5TO9:PRINT@ZZ*32,"           ";:NEXT:FORZZ=10TO14:PRINT@ZZ*32,"":NEXT
2010 PRINT@480,"                               ";:RETURN
3000 C(VAL(MID$(T$(A),2,1)))=C(VAL(MID$(T$(A),2,1)))+1:C(VAL(RIGHT$(T$(A),1)))=C(VAL(RIGHT$(T$(A),1)))+1:RETURN
5000 PRINT@480,"* HIT ENTER * ";:INPUTA$:CLS:RETURN
9000 IFD<>2THENIFTR=0ANDHM=0THENPRINT@416,"NO DOUBLE IN PLAY--REDEAL":FORA=1TO2500:NEXT:GOSUB150:GOTO15
9050 GOTO295
9060 IF(H>T)+(TR=0)THENL=H:PRINT"YOU'RE HIGH WITH "H"/"H;:PRINT@3*32+25,"SET ";:PL=2:GOTO900
9070 L=T:PRINT"I HAVE A "T"/"T:PRINT@3*32+14,"SET ";:PL=1:C(T)=C(T)-2:GOTO900
9080 IF((H>T)*(TR=1))+((HM=0)*(TR=1))THEN9082
9081 GOTO9085
9082 L=T:PRINT"I HAVE A "T"/"T"      ";:TT=TT+2:C(T)=C(T)-2:GOSUB1400:PRINT@3*32+14,"SET ";:PL=1:GOTO900
9085 IFHM=1THENL=H:PRINT"YOU'RE LOW WITH A "H"/"H;:TP=TP+2:GOSUB1400:PRINT@3*32+25,"SET ";:PL=2:GOTO900
9086 GOTO299
9090 ON1-(D=1)GOTO9095:ON1-(HM=0)GOTO9091:H=-1:GOTO9095
9091 ON1-(TR=0)GOTO9095:T=-1
9095 ON1-(D=3)GOTO9100:ON1-(HM=0)GOTO9096:H=8:GOTO9100
9096 ON1-(TR=0)GOTO9100:T=8
9100 IFD=1THENIFH>T THENIFMID$(P$(A),2,1)<>RIGHT$(P$(A),1)THEN9500
9150 IFD=1THENIFT>H THENIFMID$(T$(W),2,1)<>RIGHT$(T$(W),1)THEN9500
9160 IFD=3THENIFH<T THENIFMID$(P$(A),2,1)<>RIGHT$(P$(A),1)THEN9500
9170 IFD=3THENIFT<H THENIFMID$(T$(W),2,1)<>RIGHT$(T$(W),1)THEN9500
9200 RETURN
9300 H=-1:RETURN
9500 PRINT@416,"COMPUTER ERROR--REDEAL":FORA=1TO2500:NEXT:GOSUB150:PRINT@416,"":GOTO15
9510 DD$(0)="إ":DD$(1)="إ":DD$(2)="إ":DD$(3)="إ":FORZZ=0TO3:PRINT@32*(6+ZZ)+18,DD$(ZZ);:NEXT:RETURN
9515 RETURN
9600 DD$(0)="دددددد"
9601 DD$(1)="دددددد"
9602 DD$(2)="دددددد"
9603 DD$(3)="دددددد"
9605 RETURN
9610 DD$(0)="دددددد"
9611 DD$(1)="ددخحدد"
9612 DD$(2)="ددثادد"
9613 DD$(3)="دددددد"
9615 RETURN
9620 DD$(0)="دجدددد"
9621 DD$(1)="دأدددد"
9622 DD$(2)="ددددجد"
9623 DD$(3)="ددددأد"
9625 RETURN
9630 DD$(0)="دجدددد"
9631 DD$(1)="دأخحدد"
9632 DD$(2)="ددثاجد"
9633 DD$(3)="ددددأد"
9635 RETURN
9640 DD$(0)="دجددجد"
9641 DD$(1)="دأددأد"
9642 DD$(2)="دجددجد"
9643 DD$(3)="دأددأد"
9645 RETURN
9650 DD$(0)="دجددجد"
9651 DD$(1)="دأخحأد"
9652 DD$(2)="دجثاجد"
9653 DD$(3)="دأددأد"
9655 RETURN
9660 DD$(0)="دجخحجد"
9661 DD$(1)="دأثاأد"
9662 DD$(2)="دجخحجد"
9663 DD$(3)="دأثاأد"
9665 RETURN
9700 REM REMOVE REM IN LINE 299 TO SEE COMPUTER PLAY
